package java8_26.chongwu;

/**
 * @author oldliu
 * @since 1.0
 */
public class FlowerAndBirdMarket {
    private String name;
    public FlowerAndBirdMarket(String n){
        name=n;
    }
    //以多态的方式来返回值
    public Pet sell(int money){
        if(money>500000){
            return new Tiger("小花花","公",100,100);
        }else if(money>100000){
            return new Penguin("小蓝企鹅","公",99,99);
        }else if(money>=1500){
            return new Dog("傻二哈","公",70,70);
        }else if(money>=300){
            return new Dog("大黄","公",70,70);
        }
        return null;
    }
}
